﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Sio.Mdm.Entities;

namespace IDM.Types
{
    [Entity(
        "IDM.BF.AdministrationService.IUsersService, IDM.BF.IAdministrationService",
        TableName="Users"
    )]    
    public interface User : IEntity
    {
        [PrimaryKey] 
        int ID { get; set; }
        
        [Field(Name="Username")]         
        string Name { get; set; }
        
        [Field(Name="\"Password\"")] 
        [NullOrEmptyValidation(ValidationState=EntityState.Created)]
        string Password { get; set; }
        
        [Field(UpdateValue="current_timestamp")] 
        DateTime Changed { get; set; }

        [Method(MethodName="IsValidUser")]
        bool Exists();
    }
}
